package free.jsf.control;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class TestServlet extends HttpServlet{
	
	protected void traitementServlet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException{
				
				resp.setContentType("text/html");
				PrintWriter out = resp.getWriter();
				out.append("<html><head><title>Premier Page Hello</title></head><body>");
				out.append("Hello JSF");
				out.append("</body></html>");
				
			}

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		traitementServlet(req, resp);
		
	} 
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		traitementServlet(req, resp);
	}
	
	
}
